import request from '@/utils/request'

// 查询列表
export function listBudgeting(query) {
  return request({
    url: '/budget-info/list',
    method: 'post',
    data: query
  })
}

// 查询详细
export function getBudgetingDetail(roleId) {
  return request({
    url: '/budget-info/getById/' + roleId,
    method: 'get'
  })
}
// 获取 片区
export function getDept() {
  return request({
    url: '/auth/dept/treeselect',
    method: 'get'
  })
}
// 新增
export function addBudgetingDetail(data) {
  return request({
    url: '/budget-info/add',
    method: 'post',
    data: data
  })
}

// 修改
export function updateBudgetingDetail(data) {
  return request({
    url: '/budget-info/update',
    method: 'post',
    data: data
  })
}

// 软删除
export function delBudgeting(roleId) {
  if (!(roleId instanceof Array)){
    roleId = [roleId]
  }
  return request({
    url: '/budget-info/delete',
    method: 'post',
    data: roleId,
  })
}

// 片区 下拉选
export function zoneOption(){
  return request({
    url: '/budget-info/option',
    method: 'get'
  })
}
